﻿/************************************************************************/
/* File Name   : lawinedef.h                                            */
/* Creator     : ax.minaduki@gmail.com                                  */
/* Create Time : March 27th, 2010                                       */
/* Module      : Lawine library                                         */
/* Descript    : Lawine library definition                              */
/************************************************************************/

#ifndef __SD_LAWINE_LAWINEDEF_H__
#define __SD_LAWINE_LAWINEDEF_H__

/************************************************************************/

#include <common.h>

/************************************************************************/

#define L_ERA_ERROR				-1
#define L_ERA_BADLANDS			0
#define L_ERA_PLATFORM			1
#define L_ERA_INSTALL			2
#define L_ERA_ASHWORLD			3
#define L_ERA_JUNGLE			4
#define L_ERA_DESERT			5
#define L_ERA_ICE				6
#define L_ERA_TWILIGHT			7
#define L_ERA_NUM				8

#define L_TILE_SIZE				32

#define L_SPK_WIDTH				640
#define L_SPK_HEIGHT			480

enum {
	L_BRUSH_BADLANDS_DIRT,
	L_BRUSH_BADLANDS_MUD,
	L_BRUSH_BADLANDS_HIGH_DIRT,
	L_BRUSH_BADLANDS_WATER,
	L_BRUSH_BADLANDS_GRASS,
	L_BRUSH_BADLANDS_HIGH_GRASS,
	L_BRUSH_BADLANDS_STRUCTURE,
	L_BRUSH_BADLANDS_ASPHALT,
	L_BRUSH_BADLANDS_ROCKY_GROUND,
	L_BRUSH_BADLANDS_NUM,
};

enum {
	L_BRUSH_PLATFORM_SPACE,
	L_BRUSH_PLATFORM_LOW_PLATFORM,
	L_BRUSH_PLATFORM_RUSTY_PIT,
	L_BRUSH_PLATFORM_PLATFORM,
	L_BRUSH_PLATFORM_DARK_PLATFORM,
	L_BRUSH_PLATFORM_PLATING,
	L_BRUSH_PLATFORM_SOLAR_ARRAY,
	L_BRUSH_PLATFORM_HIGH_PLATFORM,
	L_BRUSH_PLATFORM_HIGH_PLATING,
	L_BRUSH_PLATFORM_ELEVATED_CATWALK,
	L_BRUSH_PLATFORM_NUM,
};

enum {
	L_BRUSH_INSTALL_SUBSTRUCTURE,
	L_BRUSH_INSTALL_FLOOR,
	L_BRUSH_INSTALL_ROOF,
	L_BRU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Y_SUNKEN_PIT,
	L_BRUSH_DESERT_HIGH_COMPOUND,
	L_BRUSH_DESERT_NUM,
};

enum {
	L_BRUSH_ICE_ICE,
	L_BRUSH_ICE_SNOW,
	L_BRUSH_ICE_MOGULS,
	L_BRUSH_ICE_DIRT,
	L_BRUSH_ICE_ROCKY_SNOW,
	L_BRUSH_ICE_GRASS,
	L_BRUSH_ICE_WATER,
	L_BRUSH_ICE_OUTPOST,
	L_BRUSH_ICE_HIGH_SNOW,
	L_BRUSH_ICE_HIGH_DIRT,
	L_BRUSH_ICE_HIGH_GRASS,
	L_BRUSH_ICE_HIGH_WATER,
	L_BRUSH_ICE_HIGH_OUTPOST,
	L_BRUSH_ICE_NUM,
};

enum {
	L_BRUSH_TWLIGHT_WATER,
	L_BRUSH_TWLIGHT_DIRT,
	L_BRUSH_TWLIGHT_MUD,
	L_BRUSH_TWLIGHT_CRUSHED_ROCK,
	L_BRUSH_TWLIGHT_CREVICES,
	L_BRUSH_TWLIGHT_FLAGSTONES,
	L_BRUSH_TWLIGHT_SUNKEN_GROUND,
	L_BRUSH_TWLIGHT_BASILICA,
	L_BRUSH_TWLIGHT_HIGH_DIRT,
	L_BRUSH_TWLIGHT_HIGH_CRUSHED_ROCK,
	L_BRUSH_TWLIGHT_HIGH_FLAGSTONES,
	L_BRUSH_TWLIGHT_HIGH_SUNKEN_GROUND,
	L_BRUSH_TWLIGHT_HIGH_BASILICA,
	L_BRUSH_TWLIGHT_NUM,
};

typedef struct {
	WORD mega_index:4;
	WORD group_no:12;
} LTILEIDX;

typedef struct {
	WORD pos:4;
	WORD isom:8;
	WORD unused:4;
} LISOMCOORD;

typedef struct {
	LISOMCOORD left;
	LISOMCOORD top;
	LISOMCOORD right;
	LISOMCOORD bottom;
} LISOMTILE;

typedef LTILEIDX		*LTILEPTR;
typedef CONST LTILEIDX	*LTILECPTR;

typedef LISOMTILE		*LISOMPTR;
typedef CONST LISOMTILE	*LISOMCPTR;

/************************************************************************/

#endif	/* __SD_WORLD_COREDEF_H__ */
